import os
import django
from channels.http import AsgiHandler
from channels.routing import ProtocolTypeRouter, URLRouter, get_default_application
from . import routing  # 这个文件后续会说，你先写上。

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Wchime.settings')
django.setup()

# application = get_default_application()

application = ProtocolTypeRouter({
    "http": AsgiHandler(),
    "websocket": URLRouter(routing.websocket_urlpatterns),
})
